import { createBrowserRouter, Navigate } from "react-router-dom";
import Welcome from "../view/Welcome";   
import Login from "../view/Login";
import Layout from "../view/layout/index.tsx";
import Dishboard from "../view/dishboard/index.tsx";
import User from "../view/user/index.tsx";
import Role from "../view/role/index.tsx";
import Dept from "../view/dept/index.tsx";
import Menu from "../view/menu/index.tsx";

const router = createBrowserRouter([
    {
       element:<Layout /> ,
       children:[
           {
            path: "/welcome",
            element:<Welcome /> ,
           },
           {
            path: "/dishboard",
            element:<Dishboard /> ,
           },
           {
            path: "/userList",
            element:<User /> ,
           },
           {
            path: "/roleList",
            element:<Role /> ,
           },
           {
            path: "/deptList",
            element:<Dept /> ,
           },
           {
            path: "/menuList",
            element:<Menu /> ,
           },
       ]
    },
    {
        path: "/",
        element:<Navigate to="/welcome" /> ,
    },
    {
        path: "/login",
        element:<Login /> ,
    }
]);

export default router;